<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width">
    <meta name="format-detection" content="telephone=yes"/>
    <title>订单</title>
    <link rel="stylesheet" href="../../css/reset.css">
    <link rel="stylesheet" href="../../css/base.css">
    <link rel="stylesheet" href="../../css/order.css">
    <style>
        .highlight { background: yellow; color: red; }
        .order-li1{width:39%;}
        .order-li2{width:45%;}
        .order-tt{position: fixed;top: 0;}
        .order-ttp{margin-top: 13%;}
    </style>
</head>
<body>
<div class="wrapper">

    <div class="order-top order-tt">
       <span class="order-select or-set">正式订单</span>
        <span class="submitted-select fr">已提交订单</span>
    </div>
    <div class="order-lis hide1">
        <img src="../../images/Artboard 30@2x.png" alt="">
        <span>还没有订单哦!</span>
    </div>
<!--正式订单列表-->
    <div class="order-list-box1  order-ttp">
         <div class="or-list1">
             <div class="search-box2">
                     <img src="../../images/Artboard%2014@2x.png" alt="">
                     <input type="search" class="search-inp" placeholder="请输入搜索词">
             </div>
         </div>
        <div class="order-list-num order-zs">

        </div>
     </div>
<!--已提交订单-->
     <div class="submitted hide1 order-ttp">
         <div class="or-list1">
             <div class="search-box2">
                 <img id="search" src="../../images/Artboard%2014@2x.png" alt="">
                 <input type="search" id="text" class="search-inp" placeholder="请输入搜索词">
             </div>
         </div>
         <div class="order-list-num order-yt">
         </div>
     </div>
<!--所以订单-->
    <div class="submitted hide1">
        <!--<div class="or-list1">-->
            <!--<div class="search-box2">-->
                <!--<img src="../../images/Artboard%2014@2x.png" alt="">-->
                <!--<input type="text" placeholder="请输入搜索词">-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="order-list-num">-->
            <!--<div class="order-det b-btm" >-->
                <!--<ul>-->
                    <!--<li class="order-li1">订单号：<span>1000000050</span></li>-->
                    <!--<li class="order-li2"><span>2017</span>年<span>6</span>月<span>7</span>日</li>-->
                    <!--<li><span class="state dis_b">未生成</span></li>-->
                <!--</ul>-->
                <!--<div class="order-box1">-->
                    <!--<div class="order-name">-->
                        <!--客户：<span>哈啰通用设备（上海）有限公司喜马拉雅店</span>-->
                    <!--</div>-->
                    <!--<div>-->
                        <!--<span>金额：<span class="red">538.00¥</span></span>-->
                    <!--</div>-->
                    <!--<div>-->
                        <!--<span>业务员：<span >张凡</span></span>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
    </div>

    <nav class="nav-list">
        <a href="../index.html">
            <span><img src="../../images/Artboard%202%20Copy%205@3x.png" alt=""></span>
            <span >首页</span>
        </a>
        <a href="javascript:void(0);">
            <span><img src="../../images/Group 32@3x.png" alt=""></span>
            <span class="list-col">订单</span>
        </a>
        <a href="../Reimbursement/reimbursement.html">
            <span><img src="../../images/Artboard%202%20Copy%207@3x.png" alt=""></span>
            <span>报销</span>
        </a>
        <a href="../Personal/personal.html">
            <span><img src="../../images/Artboard 2 Copy@3x.png" alt=""></span>
            <span >个人</span>
        </a>
    </nav>
</div>
<script src="../../js/jquery-2.1.4.min.js"></script>
<script src="../../js/base.js"></script>
<script>
//    $(document).ready(function ()
//    {
//        $('#search').click(highlight);//点击search时，执行highlight函数；
////        $('#clear').click(clearSelection);//点击clear按钮时，执行clearSelection函数；
//
//        function highlight()
//        {
//            clearSelection();//先清空一下上次高亮显示的内容；
//            var searchText = $('#text').val();//获取你输入的关键字；
//               console.log(searchText);
//
//            var regExp = new RegExp(searchText, 'g');//创建正则表达式，g表示全局的，如果不用g，则查找到第一个就不会继续向下查找了；
//            console.log(regExp);
//
//
//            $('.order-det').each(function()//遍历文章；
//            {
//
//                var newHtml ='<div class="order-det b-btm">'+
//                '<ul>'+
//                '<li class="order-li1">订单号：<span>1000000050</span></li>'+
//            '<li class="order-li2"><span>2017</span>年<span>6</span>月<span>7</span>日</li>'+
//               '<li><span class="state dis_b">未生成</span></li>' +
//                '</ul>'+
//                '<div class="order-box1">'+
//                '<div class="order-name">'+
//                '客户：<span>哈啰通用设备（上海）有限公司喜马拉雅店</span>'+
//            '</div>'+
//            '<div>'+
//            '<span>金额：<span class="red">538.00¥</span></span>'+
//            '<span class="lv">利率：<span class="red">0.00%</span></span>'+
//                '</div>'+
//                '</div>'+
//                '</div>';
//
//                $(this).html(newHtml);//更新文章；
//            });
//        }
//        function clearSelection()
//        {
//            $('.order-det').each(function()//遍历
//            {
//                $(this).find('.highlight').each(function()//找到所有highlight属性的元素；
//                {
//                    $(this).replaceWith($(this).html());//将他们的属性去掉；
//                });
//            });
//        }
//    });
</script>
<script>
    $(function(){
        $('.submitted-select').on('click',function(){
            $('.order-list-box1').hide();
            $('.submitted').show();
            $('.or-set').removeClass('order-select');
            $('.submitted-select').addClass('order-select');
            $('.submitted-select').attr('disabled',true);
        });
        $('.or-set').on('click',function(){
            $('.order-list-box1').show();
            $('.submitted').hide();
            $('.submitted-select').removeClass('order-select');
            $('.or-set').addClass('order-select');
            $('.or-set').attr('disabled',true);
        });
        $('.order-det').on('click',function(){
            window.location.href='../Order/order-details.html'
        });
    });
    var URL='http://localhost/rest/';
$.ajax({
    url:URL+'OrderListPanel_Level_Detail_Grid1?Vusercode=DEMO&Orderedby=0&start=0&count=15&gxid=23',
    dataType:'json',
    type:'GET',
    data:'id',
    success:function(data){
        console.log(data);
        var orderHtml='';
        for(var i=0;i<data.length;i++){
            var datas=data[i];
            var order_num=datas.SalesOrderView_;
            var order_time=datas.SalesOrderView_3;
            var order_zt=datas.SalesOrderView_10;
            var order_kh=datas.SalesOrderView_4;
            var order_moeny=datas.SalesOrderView_6;
            var order_lv=datas.SalesOrderView_7;
            orderHtml+= '<div class="order-det b-btm" >'+
                        '<ul>'+
                        '<li class="order-li1">订单号：<span>'+order_num+'</span></li>'+
                        '<li class="order-li2"><span>'+order_time+'</span></li>'+
                        '<li><span class="state dis_b">'+order_zt+'</span></li>'+
                        '</ul>'+
                        '<div class="order-box1">'+
                        '<div class="order-name">客户：<span>'+order_kh+'</span>'+
                        '</div>'+
                        '<div>'+
                        '<span>金额：<span class="red">'+order_moeny+'</span></span>'+
                        '<span class="lv">利率：<span class="red">'+order_lv+'</span></span>'+
                        '</div>'+
                        '</div>'+
                        '</div>'
        }
        $('.order-zs').html(orderHtml);
    }
});

    $.ajax({
        url:URL+'OrderListPanel_Level_Detail_Grid2?Vusercode=DEMO&Orderedby=0&start=0&count=15&gxid=23',
        dataType:'json',
        type:'GET',
        data:'id',
        success:function(data){
            console.log(data);
            var orderHtml='';
            for(var i=0;i<data.length;i++){
                var datas=data[i];
                var order_id=datas.App_SomainID;
                var order_code=datas.App_SomaincSOCode;
                var order_time=datas.App_SomainDate;
                var order_name=datas.App_SomaincCusName;
                var order_moeny=datas.App_SomainAmount;
                var order_sta=datas.App_SomainStatus;
                orderHtml+=
                    '<div class="order-det b-btm" >'+
                    '<ul>'+
                    '<li class="order-li1">订单号：<span>'+order_code+'</span></li>'+
                    '<li class="order-li2"><span>'+order_time+'</span></li>'+
                    '<li><span class="state dis_b">'+order_sta+'</span></li>'+
                    '</ul>'+
                    '<div class="order-box1">'+
                    '<div class="order-name">客户：<span>'+order_name+'</span>'+
                    '</div>'+
                    '<div>'+
                    '<span>金额：<span class="red">'+order_moeny+'</span></span>'+
                    '<span class="dis_b fz9">业务员：<span>'+order_id+'</span></span>'+
                    '</div>'+
                    '</div>'+
                    '</div>'

            }
            $('.order-yt').html(orderHtml);
        }
    });
</script>

</body>
</html>